


#include <gdt.h>
#include <video.h>
#include <kernel.h>
#include <memory.h>

void __parse_grub_info(struct __grub_mb_info *);

int main(struct __grub_mb_info *info){

  k_clear_scr();
  k_print("Welcome to freeGSD\n");
  k_print("Starting paged memory...\n");

  /* Deal with grub. */
  __parse_grub_info(info);
  _gdt_make_basic_gdt();
  k_print("GDT initialized\n");

  /* First flip the processor into paged memory mode. */
  __init_kernel_mem();
  k_print("Paging enabled\n");

  _idt_init_basic_idt();

  kmalloc(50);

  //for (;;);
  int i = 0;
  int j = 1;
  int p = j / i;

}

void __parse_grub_info(struct __grub_mb_info *info){

  /* Right now this is all thats important. */
  __total_memory = info->mem_upper;

}

void __kernel_panic(){

  k_print(" KERNEL PANIC \n");
  k_print(" Uncorrectable error occured.\n");
  for (;;);

}
